package com.sdkj.recruit.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.annotation.Persistent;
import org.springframework.stereotype.Service;

import com.sdkj.recruit.dao.IMongodbDAO;
import com.sdkj.recruit.dao.IUserLabelDao;
import com.sdkj.recruit.model.UserLabel;
import com.sdkj.recruit.mongoSupport.QueryParamCreator;


@Persistent
@Service("lableDao")
public class UserLabelDao implements IUserLabelDao {

	@Autowired
	private IMongodbDAO dao;

	
	@Override
	public void saveUserLabel(UserLabel label) {
		dao.saveOrUpdatePO(label);
	}


	@Override
	public void deleteLabel(String id) {
		dao.deletePOList(UserLabel.class, QueryParamCreator.eq("_id", id));
	}


	@Override
	public List<UserLabel> queryUserLabelList(String userId) {
		return dao.getPOList(UserLabel.class, QueryParamCreator.eq("userId", userId));
	}

}
